package main

import (
	"bytes"
	"encoding/binary"
	"encoding/hex"
	"fmt"
	"gitee.com/sky_big/workmod"
	"gitee.com/sky_big/workmod/myLog"
	"time"
)

var ab =make(chan bool ,0)
func main() {
	workmod.Init()
	myLog.Println("server start")
	go func() {
		myLog.Println("hehe")
		time.Sleep(time.Second*10)
		ab<-true
		myLog.Println("haha")
	}()
	myLog.Println("aa")
	//<-ab
	myLog.Println("end")
	var num =new(int32)
	var a=[]byte{
		0x25,0x88,0x86,
	}
	bytetoint(a,num)
	fmt.Println("num=========",num)

	msg:=[]byte{
		100,
	}
	//hex.Encode(msg,out)

	fmt.Println("msg===",hex.EncodeToString(msg))
	//fmt.Println("out===",out)

}
// byte 转化 int
func bytetoint(by []byte, num *int32)  {
	b_buf := bytes.NewBuffer(by)
	binary.Read(b_buf, binary.BigEndian, num)
}


